package com.vue.mapper;


import com.github.pagehelper.Page;
import com.vue.annotation.AutoFill;
import com.vue.dto.CoursePageQueryDTO;
import com.vue.entity.Course;
import com.vue.entity.PaperQuestion;
import com.vue.entity.Question;
import com.vue.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ExamMapper {

//    /**
//     * 课程分页查询
//     * @param coursePageQueryDTO
//     * @return
//     */
//    Page<Course> PageQuery(CoursePageQueryDTO coursePageQueryDTO);
//
//    /**
//     * 修改课程
//     * @param course
//     */
//    @AutoFill(OperationType.UPDATE)
//    void update(Course course);
//
//    /**
//     * 新增课程
//     * @param course
//     */
//    @AutoFill(OperationType.INSERT)
//    @Insert("insert into course(name, course_code, t_id, teacher, create_time, update_time) " +
//            "values (#{name},#{courseCode},#{tId},#{teacher},#{createTime},#{updateTime})")
//    void insert(Course course);
//
//    /**
//     * 根据id删除课程
//     * @param id
//     */
//    @Delete("delete from course where id = #{id}")
//    void deleteById(Long id);

    @Select("select q.* from paper p" +
            "    join paper_question pq on p.id = pq.paper_id" +
            "    join question q on q.id = pq.question_id " +
            "order by q.type;")
    Question examList();
}
